export const optionBar = {
  title: {
    // text: '周销售额趋势',
    show: false
  },
  grid: {
    right: 0,
    bottom: 35,
    top: 35,
    left: 55
  },
  legend: {
    show: false
  },
  xAxis: {
    // data: ['10/31', '11/01', '11/02', '11/03', '11/04', '11/05', '11/06'],
    data: Array.from({ length: 7 }).map((e, i) => {
      const date = new Date()
      return `${date.getMonth() + 1}/${date.getDate() - 6 + i}`
    }),
    axisLine: {
      style: {
        stroke: '#5E83B6',
        lineWidth: 1
      }
    },
    axisTick: {
      style: {
        stroke: '#5E83B6',
        lineWidth: 1
      }
    },
    axisLabel: {
      style: {
        fill: '#BFDAFF',
        fontSize: 28,
        rotate: 0
      }
    }
  },
  yAxis: {
    // name: '数量 / 人数',
    data: 'value',
    min: 0,
    splitLine: {
      show: false
    },
    nameTextStyle: {
      fill: '#fff',
      fontSize: 28
    },
    axisLine: {
      style: {
        stroke: '#5E83B6',
        lineWidth: 1
      }
    },
    axisTick: {
      style: {
        stroke: '#5E83B6',
        lineWidth: 1
      }
    },
    axisLabel: {
      style: {
        fill: '#5E83B6',
        fontSize: 28,
        rotate: 0
      }
    }
  },
  series: [
    {
      name: '系列A',
      data: [100, 100, 130, 160, 180, 140, 100],
      type: 'bar',
      // shapeType: 'rightEchelon'
      gradient: {
        color: ['rgba(14,167,254,0.80)', 'rgba(68,126,233,0.30)']
      }
    },
    {
      name: '系列B',
      data: [180, 170, 160, 150, 200, 50, 140],
      type: 'bar',
      gradient: {
        color: ['rgba(254,196,32,0.70)', 'rgba(254,115,32,0.25)']
      },
      barWidth: 10
    }
  ]
}
export const optionBar1 = {
  title: {
    // text: '周销售额趋势',
    show: false
  },
  grid: {
    right: 0,
    bottom: 35,
    top: 35,
    left: 55
  },
  legend: {
    show: false
  },
  xAxis: {
    data: [
      '一月', '二月', '三月', '四月', '五月', '六月',
      '七月', '八月', '九月', '十月'
    ],
    axisLine: {
      style: {
        stroke: '#5E83B6',
        lineWidth: 1
      }
    },
    axisTick: {
      style: {
        stroke: '#5E83B6',
        lineWidth: 1
      }
    },
    axisLabel: {
      style: {
        fill: '#BFDAFF',
        fontSize: 28,
        rotate: 0
      }
    }
  },
  yAxis: {
    // name: '数量 / 人数',
    data: 'value',
    min: 0,
    max: 800,
    splitLine: {
      show: false
    },
    nameTextStyle: {
      fill: '#fff',
      fontSize: 28
    },
    axisLine: {
      style: {
        stroke: '#5E83B6',
        lineWidth: 1
      }
    },
    axisTick: {
      style: {
        stroke: '#5E83B6',
        lineWidth: 1
      }
    },
    axisLabel: {
      style: {
        fill: '#5E83B6',
        fontSize: 28,
        rotate: 0
      }
    }
  },
  series: [
    {
      name: '气温',
      data: [500, 200, 600, 100, 300, 400, 100, 400, 100, 100],
      type: 'line',
      // yAxisIndex: 1,
      animationCurve: 'easeOutBounce',
      stack: 'a',
      lineStyle: {
        lineWidth: 3
      },
      linePoint: {
        fill: '#fff',
        lineWidth: 1
      }
    },
    {
      name: '系列A',
      data: [100, 100, 130, 160, 180, 140, 100, 100, 400, 100, 100],
      type: 'bar',
      // shapeType: 'rightEchelon'
      gradient: {
        color: ['rgba(70,172,255,0.80)']
      },
      stack: 'a'
    },
    {
      name: '系列B',
      data: [200, 170, 160, 150, 200, 50, 140, 100, 400, 100, 100],
      type: 'bar',
      gradient: {
        color: ['rgba(184,61,255,0.80)']
      },
      // barWidth: 40,
      stack: 'a'
    },
    {
      name: '系列c',
      data: [300, 170, 160, 150, 200, 50, 140, 100, 400, 100, 100],
      type: 'bar',
      gradient: {
        color: ['rgba(255,172,44,0.80)']
      },
      // barWidth: 40,
      stack: 'a'
    },
    {
      name: '系列c',
      data: [500, 170, 160, 150, 200, 50, 140, 100, 400, 100, 100],
      type: 'bar',
      gradient: {
        color: ['rgba(255,46,51,0.80)']
      },
      barWidth: 40,
      stack: 'a'
    }

  ]
}
export const optionPie = {
  title: {
    show: false
    // text: '畅销饮料占比饼状图'
  },
  legend: {
    // data: ['同比', '环比'],
    // orient: 'vertical'
    show: false
  },
  series: [
    // {
    //   name: '同比',
    //   type: 'pie',
    //   data: [
    //     { name: '初中及以下', value: 93 },
    //     { name: '高中', value: 32 },
    //     { name: '专科', value: 65 },
    //     { name: '本科', value: 44 },
    //     { name: '研究生及以上', value: 52 }
    //   ],
    //   radius: '30%',
    //   // outsideLabel: {
    //   //   show: false
    //   // },
    //   outsideLabel: {
    //     show: false
    //   },
    //   insideLabel: {
    //     show: true
    //   }
    // },
    {
      name: '环比',
      type: 'pie',
      data: [
        { name: '初中及以下', value: 93 },
        { name: '高中', value: 32 },
        { name: '专科', value: 65 },
        { name: '本科', value: 44 },
        { name: '研究生及以上', value: 52 }
      ],
      radius: ['40%', '50%'],
      outsideLabel: {
        show: false,
        labelLineEndLength: 0
      },
      insideLabel: {
        // show: true,
        style: {
          fontSize: 24,
          fill: '#fff'
          // textAlign: 'center',
          // textBaseline: 'middle'
        }
      }
    }
  ]
}
